<?php
/*=============================================================================
|| ##################################################################
||	phpFoX Konsort
|| ##################################################################
||	
||	Copyright		: (C) 2005-2007 PHPFOX Limited a Reality Fox Creation
||	Contact			: info@phpfox.com
||
||	- phpFoX and all of its source code and files are protected by Copyright Laws. 
||
||	- The license for phpFoX permits you to install this software on a single domain (.com, .org, .net, etc.). 
||
||	- You may also not remove this copyright screen which shows the copyright information and credits for phpFoX (RealityFOX Creations). 
||
||	- phpFoX Konsort is NOT a FREE software - http://www.phpfox.com/license/
||
|| ##################################################################
=============================================================================*/

/* $File: ./include/modules/Account/classes/PhpFox_ComponentVerify.class.php, $Author:  $ */



/** Verify (after registration) user component.
 *   
 * Parameters:
 *  1. url_login (manadtory) - login page logical name
 * 
 * @package module.account
 * @version $Id: PhpFox_ComponentVerify.class.php 416 2008-03-28 07:20:51Z phpfoxsv $
 *   
 */
class PhpFox_Mod_Account_ComponentVerify extends BaseComponent
{

    /** Processing method
     */
	function process()
	{
	    $oReq = &App::getRequest();
		$iId = $oReq->getInt('id');
		$sCode = $oReq->get('code');
		$sVerify = $oReq->get('verify');
		
		$oSrvAccount = $this->_oModule->getService('Account');
		/* @var $oSrvAccount PhpFox_Mod_Account_ServiceAccount */
		$bRes = $oSrvAccount->verifyNewUser($iId, $sCode, $sVerify);
		$_SESSION['redirect_url'] = App::getParam('header_location');
		$oTpl = &$this->_oModule->getTemplate('Verify.html');
		$oTpl->assign(array(
			'bVerify'   => $bRes,
			'sLoginUrl' => App::makeUrl($this->getParam('url_login', 'public.login')),
		));
		$sHtml = $oTpl->fetch('Verify.html');
		return $sHtml;
	}

}
?>